<?php

/**
 * Estudiantes form base class.
 *
 * @method Estudiantes getObject() Returns the current form's model object
 *
 * @package    Fix_Student
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseEstudiantesForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'idestudiante'      => new sfWidgetFormInputHidden(),
      'cedula'            => new sfWidgetFormInputText(),
      'matricula'         => new sfWidgetFormInputText(),
      'nombres'           => new sfWidgetFormInputText(),
      'apellidos'         => new sfWidgetFormInputText(),
      'fechadenacimiento' => new sfWidgetFormDate(),
      'direccion'         => new sfWidgetFormInputText(),
      'telefono'          => new sfWidgetFormInputText(),
      'email'             => new sfWidgetFormInputText(),
      'sexo'              => new sfWidgetFormInputText(),
      'idcurso'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Cursos'), 'add_empty' => false)),
      'idcarrera'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Carreras'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'idestudiante'      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('idestudiante')), 'empty_value' => $this->getObject()->get('idestudiante'), 'required' => false)),
      'cedula'            => new sfValidatorString(array('max_length' => 11)),
      'matricula'         => new sfValidatorInteger(),
      'nombres'           => new sfValidatorString(array('max_length' => 45)),
      'apellidos'         => new sfValidatorString(array('max_length' => 45)),
      'fechadenacimiento' => new sfValidatorDate(),
      'direccion'         => new sfValidatorString(array('max_length' => 100)),
      'telefono'          => new sfValidatorString(array('max_length' => 30)),
      'email'             => new sfValidatorString(array('max_length' => 45)),
      'sexo'              => new sfValidatorString(array('max_length' => 10)),
      'idcurso'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Cursos'))),
      'idcarrera'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Carreras'))),
    ));

    $this->widgetSchema->setNameFormat('estudiantes[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Estudiantes';
  }

}
